//
//  NowPendingHeaderView.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/7/6.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "NowPendingHeaderView.h"

@interface NowPendingHeaderView ()

@property (nonatomic, strong)UILabel * winLostLabel;

@property (nonatomic, strong)UIButton * totalSellButton;

@property (nonatomic, strong)UILabel * definiteLabel;

@property (nonatomic, strong)UILabel * sellMaxLabel;

@property (nonatomic, strong)UILabel * sellMinLabel;

@end

@implementation NowPendingHeaderView


- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        //在这里向contentView添加控件
        [self setupUI];
    }
    return self;
}



- (void)setupUI{
    
    self.winLostLabel = [UILabel new];
    
    self.winLostLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    self.winLostLabel.textColor = ColorWithRGB(0xffffff);
    self.winLostLabel.textAlignment = NSTextAlignmentLeft;
    self.winLostLabel.text = @"浮动盈亏($)";
    
    [self addSubview:self.winLostLabel];
    
    [self.winLostLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(25 * SCREENH6);
        make.top.mas_equalTo(self).offset(15 * SCREENH6);
    }];
    
    self.totalSellButton = [UIButton new];
    
    [self.totalSellButton setTitle:@"全平" forState:UIControlStateNormal];
    self.totalSellButton.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14 * SCREENH6];
    [self.totalSellButton setTitleColor:ColorWithRGB(0xd7d9d8) forState:UIControlStateNormal];
    
    
    [self addSubview:self.totalSellButton];
    
    [self.totalSellButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self).offset(- 15 * SCREENH6);
        make.top.mas_equalTo(self.winLostLabel);
    }];
    
    
    self.definiteLabel = [UILabel new];
    
    self.definiteLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:30 * SCREENH6];
    self.definiteLabel.textColor = ColorWithRGB(0xf4415f);
    self.definiteLabel.textAlignment = NSTextAlignmentLeft;
    self.definiteLabel.text = @"+$0.88";
    
    [self addSubview:self.definiteLabel];
    
    [self.definiteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.winLostLabel);
        make.top.mas_equalTo(self.winLostLabel.mas_bottom);
    }];
    
    
    self.sellMaxLabel = [UILabel new];
    
    self.sellMaxLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    self.sellMaxLabel.textColor = ColorWithRGB(0x979797);
    self.sellMaxLabel.textAlignment = NSTextAlignmentLeft;
    self.sellMaxLabel.text = @"平多价";
    
    [self addSubview:self.sellMaxLabel];
    
    [self.sellMaxLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(153 * SCREENH6);
        make.bottom.mas_equalTo(self.mas_bottom).offset(- 10 * SCREENH6);
    }];
    
    
    self.sellMinLabel = [UILabel new];
    
    self.sellMinLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:13 * SCREENH6];
    self.sellMinLabel.textColor = ColorWithRGB(0x979797);
    self.sellMinLabel.textAlignment = NSTextAlignmentLeft;
    self.sellMinLabel.text = @"平空价";
    
    [self addSubview:self.sellMinLabel];
    
    [self.sellMinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(268 * SCREENH6);
        make.top.mas_equalTo(self.sellMaxLabel);
    }];
    
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
